package com.gilight.base.dao;

import com.gilight.base.model.SysUserZzjg;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface SysUserZzjgMapper {
    int deleteByPrimaryKey(Long id);

    int insert(SysUserZzjg record);

    int insertSelective(SysUserZzjg record);

    SysUserZzjg selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysUserZzjg record);

    int updateByPrimaryKey(SysUserZzjg record);

    int countList(Map<String, Object> map);

    List<String> getManagerByZzjgId(Long zzjgId);

    List<String> getParentManagerByZzjgId(Long zzjgId);

    List<String> getManagerByUserCode(String userCode);

    List<String> getParentManagerByUserCode(String userCode);
    List<Map<String, Object>> getUserZzjgList(Map<String, Object> map);

    List<Map<String, Object>> getUserByZzjg(Map<String, Object> map);

    void delUserZzjg(@Param(value = "zzjgId") String zzjgId, @Param(value = "userId") String userId);

    List<Map<String, Object>> getByUserZzjg(Map<String, Object> map);

    /**
     * 获取教务处负责人
     *
     * @return
     * @Author: wuzz
     * @Date 2019/11/12 15:05
     */
    List<String> getJwcManager();

    /**
     * 获取院领导负责人
     *
     * @return
     * @Author: wuzz
     * @Date 2019/11/12 15:05
     */
    List<String> getYldManager();

    int isManager(String zzjgId);
    //取消当前部门的负责人
    int cancelCurrentManager(String zzjgId);
    //设置部门负责人
    int setManager(@Param(value = "zzjgId") String zzjgId, @Param(value = "userId") String userId);

    /**
     * 根据用户ID获取用户所在的组织机构
     *
     * @param userId
     * @return
     * @Author: wuzz
     * @Date 2019/11/21 13:44
     */
    List<Map<String, Object>> getUserZzjgsByUserId(@Param(value = "userId") Long userId);

    /**
     * 获取当前组织机构上上级的负责人
     *
     * @param zzjgId
     * @return
     * @Author: wuzz
     * @Date 2019/11/22 8:43
     */
    List<String> getParentAndParentZzjgManager(@Param(value = "zzjgId") Long zzjgId);

    List<String> getManagerZzjgType(@Param(value = "userId") Long userId);

    List<Map<String, Object>> getManagerByZzjgTypes(@Param(value = "zzjgTypes") List<String> zzjgTypes);
}